Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cache sizes for image cache and custom size text improvement #4003

Merged
merged 4 commits into from
Oct 19, 2024

Conversation

twistios
Copy link

@twistios twistios commented Oct 14, 2024

Changes:

  • added 8 GB size for image cache (for consistency with ExoPlayerDiskCacheMaxSize)
  • added custom size for image cache (text with new style for usage), it seems like unlimited is not possible
  • applied the same style for usage on song cache custom size text
Before

rimusic_cache_size_before

After

rimusic_cache_size_after

Also: valueMax of InputNumericDialog is currently ignored which currently is good

- added options for 8GB and custom size
- applied new formatting for custom size (usage)
- applied new formatting for custom size (usage)
- removed "exoPlayerCustomCache" in when-case (not used and also can never be reached)
@twistios
Copy link
Author

twistios commented Oct 14, 2024

Sometimes I get some internal compile errors saying something like "could not find virtual file Dialog for inline" or similar. But they go away if I clean the project and build again.

@twistios
Copy link
Author

twistios commented Oct 14, 2024

The new variant for custom size usage text maybe is not good for RTL languages or I don't understand how they work.

@twistios
Copy link
Author

Ok, maybe there is a problem with maxValue not working:

NumberFormatException

java.lang.NumberFormatException: For input string: "6400000000"
	at java.lang.Integer.parseInt(Integer.java:797)
	at java.lang.Integer.parseInt(Integer.java:915)
	at it.fast4x.rimusic.ui.screens.settings.DataSettingsKt$DataSettings$lambda$115$lambda$97$$inlined$InputNumericDialog$1$3.invoke(Dialog.kt:703)
	at it.fast4x.rimusic.ui.screens.settings.DataSettingsKt$DataSettings$lambda$115$lambda$97$$inlined$InputNumericDialog$1$3.invoke(Dialog.kt:696)
	at androidx.compose.foundation.ClickableNode$clickPointerInput$3.invoke-k-4lQ0M(Clickable.kt:639)
	at androidx.compose.foundation.ClickableNode$clickPointerInput$3.invoke(Clickable.kt:633)
	at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1.invokeSuspend(TapGestureDetector.kt:255)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:165)
	at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:154)
	at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:470)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$kotlinx_coroutines_core(CancellableContinuationImpl.kt:504)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$kotlinx_coroutines_core$default(CancellableContinuationImpl.kt:493)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:359)
	at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:719)
	at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl.dispatchPointerEvent(SuspendingPointerInputFilter.kt:598)
	at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:620)
	at androidx.compose.foundation.AbstractClickableNode.onPointerEvent-H0pRuoY(Clickable.kt:1044)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:387)
	at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:229)
	at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:144)
	at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:120)
	at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1994)
	at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1945)
	at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1829)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
	at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:490)
	at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1904)
	at android.app.Dialog.dispatchTouchEvent(Dialog.java:910)
	at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:448)
	at android.view.View.dispatchPointerEvent(View.java:15919)
	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:7021)
	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6815)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6229)
	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6286)
	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6252)
	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6417)
	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6260)
	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6474)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6233)
	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6286)
	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6252)
	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6260)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6233)
	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:9211)
	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:9162)
	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:9131)
	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9337)
	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:267)
	at android.os.MessageQueue.nativePollOnce(Native Method)
	at android.os.MessageQueue.next(MessageQueue.java:335)
	at android.os.Looper.loopOnce(Looper.java:162)
	at android.os.Looper.loop(Looper.java:294)
	at android.app.ActivityThread.main(ActivityThread.java:8177)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@df592a2, androidx.compose.runtime.BroadcastFrameClock@f88fb33, StandaloneCoroutine{Cancelling}@64eaef0, AndroidUiDispatcher@66dcc69]

@twistios
Copy link
Author

I also got this error (I did not yet check what exactly happens):

ArithmeticException

java.lang.ArithmeticException: divide by zero
	at it.fast4x.rimusic.ui.screens.settings.DataSettingsKt.DataSettings(DataSettings.kt:564)
	at it.fast4x.rimusic.ui.screens.settings.DataSettingsKt.DataSettings$lambda$116(Unknown Source:6)
	at it.fast4x.rimusic.ui.screens.settings.DataSettingsKt.$r8$lambda$zjg2G3vfjsNVWHfoValr9C_d2f4(Unknown Source:0)
	at it.fast4x.rimusic.ui.screens.settings.DataSettingsKt$$ExternalSyntheticLambda6.invoke(D8$$SyntheticClass:0)
	at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:192)
	at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2825)
	at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:3116)
	at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3607)
	at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3552)
	at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:948)
	at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1206)
	at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:132)
	at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:616)
	at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:585)
	at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:41)
	at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
	at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
	at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1337)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1348)
	at android.view.Choreographer.doCallbacks(Choreographer.java:952)
	at android.view.Choreographer.doFrame(Choreographer.java:878)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1322)
	at android.os.Handler.handleCallback(Handler.java:958)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:205)
	at android.os.Looper.loop(Looper.java:294)
	at android.app.ActivityThread.main(ActivityThread.java:8177)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@458fd81, androidx.compose.ui.platform.MotionDurationScaleImpl@9e76e26, StandaloneCoroutine{Cancelling}@27daa67, AndroidUiDispatcher@c172014]

@fast4x
Copy link
Owner

fast4x commented Oct 15, 2024

So have two errors or only one?

@twistios
Copy link
Author

twistios commented Oct 15, 2024

The NumberFormatException happens if one sets the size too large and the other error is related to this, but for that error I am not sure how it is created.

The reason why this NumberFormatException error exists is that the input is a string with arbitrary size and is then converted to integer (finite size).

I know that it only happens for a size of >4000 TB but still the user can enter such values.

@twistios
Copy link
Author

I forgot that the size also has to be applied. Do I have to change it also somewhere else?

@twistios
Copy link
Author

I have tested with 32 MB and it seems to be getting applied now correctly.

@twistios twistios marked this pull request as ready for review October 18, 2024 22:41
@fast4x fast4x merged commit b8ef328 into fast4x:master Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants